/**
 * 交易评级
 */
import React  from 'react'
import style from './index.less'
import { DataNone} from '../../components'
import {Table,Row,Col} from 'antd';


const TradeRate =({data})=>{
  const myProps={
          columns: [
            {
              title: '',
              dataIndex: 'name',
              key: 'name'
            }, {
              title: '交易笔数',
              dataIndex: 'count',
              key: 'count'
            }, {
              title: '交易额度',
              dataIndex: 'balance',
              key: 'balance'
            }
          ],
          dataSource: [
            {
              key: '1',
              name: 'Good',
              count: data.goodcount,
              balance: data.goodbalance
            }, {
              key: '2',
              name: 'Normal',
              count: data.normalcount,
              balance: data.normalbalance
            }, {
              key: '3',
              name: 'Bad',
              count: data.badcount,
              balance: data.badbalance
            }, {
              key: '4',
              name: 'N/A',
              count: data.nacount,
              balance: data.nabalance
            }
          ],
          rowkey:'name'
        },
        bps= data.potentialBps,
        cny= data.potentialCNY,
        diff= data.spreadcapture
  return(
        <div className={`table ${style.tradeRate}`}>
          <div>
            <Table {...myProps} pagination={false} size="small"/>
            <div className="total">
              <Row>
                <Col span={12}>
                  <p><b>潜在提升能力：</b>
                    {bps} Bps<br/>
                     {cny} CNY</p>
                </Col>
                <Col span={12}>
                  <p><b>价差捕获能力：</b>{diff}</p>
                </Col>
              </Row>
            </div>

          </div>
        </div>
  )
}

// TradeRate.propTypes={
// data
// }

export default TradeRate
